home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / bin / dh_installdefoma < prev    next >
Text File  |  2006-06-17  |  2KB  |  62 lines

  1. #!/usr/bin/perl -w
  2. #
  3. # Registration with defoma.
  4.  
  5. use Debian::Debhelper::Dh_Lib;
  6. init();
  7.  
  8. use FileHandle;
  9.  
  10. my $fh = new FileHandle("debian/control", "r");
  11. my @l = $fh->getlines();
  12. $fh->close();
  13.  
  14. foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
  15.         $TMP=tmpdir($PACKAGE);
  16.     my $defoma = pkgfile($PACKAGE, "defoma");
  17.     my $udefoma = pkgfile($PACKAGE, "udefoma");
  18.         my $hints = pkgfile($PACKAGE, "defoma-hints");
  19.  
  20.         if ( $defoma ne '' ) {
  21.             if ( ! -d "$TMP/usr/share/defoma/scripts/") {
  22.               doit("install","-d","$TMP/usr/share/defoma/scripts/");
  23.             }
  24.             doit("install","-m0644","$defoma","$TMP/usr/share/defoma/scripts/$PACKAGE.defoma");
  25.         }
  26.     if ( $udefoma ne '' ) {
  27.             if ( ! -d "$TMP/usr/share/defoma/scripts/") {
  28.               doit("install","-d","$TMP/usr/share/defoma/scripts/");
  29.             }
  30.             doit("install","-m0644","$udefoma","$TMP/usr/share/defoma/scripts/$PACKAGE.udefoma");
  31.         }
  32.  
  33.         if ( $hints ne '' ) {
  34.             if ( ! -d "$TMP/etc/defoma/hints/") {
  35.               doit("install","-d","$TMP/etc/defoma/hints/");
  36.             }
  37.             doit("install","-m0644","$hints","$TMP/etc/defoma/hints/$PACKAGE.hints");
  38.         }
  39.  
  40.  
  41.     if ($defoma) {
  42.         if (! $dh{NOSCRIPTS}) {
  43.         autoscript($PACKAGE,"postinst","postinst-defoma",
  44.                "s/#PACKAGE#/$PACKAGE/;");
  45.         autoscript($PACKAGE,"prerm","prerm-defoma",
  46.                "s/#PACKAGE#/$PACKAGE/;");
  47.         autoscript($PACKAGE,"postrm","postrm-defoma",
  48.                "s/#PACKAGE#/$PACKAGE/;");
  49.         }
  50.     }
  51.  
  52.     if ($hints) {
  53.         if (! $dh{NOSCRIPTS}) {
  54.         autoscript($PACKAGE,"postinst","postinst-defoma-hints",
  55.                "s/#PACKAGE#/$PACKAGE/;");
  56.  
  57.                 autoscript($PACKAGE,"prerm","prerm-defoma-hints",
  58.                "s/#PACKAGE#/$PACKAGE/;");
  59.         }
  60.     }
  61. }
  62.